import request from '@/utils/request'

/**
 * @description 获取员工列表
 */
export function getEmployeeList(params) {
  return request({
    url: '/sys/user',
    params
  })
}

/**
    * @description: 删除员工
    * @param {*} id 员工id
    * @return {*}
    */
export function delEmployee(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

/**
 * @description 新增员工
 * @param {*} data
 */
export function addEmployeeAPI(data) {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

/**
 * @description 批量导入员工
 * @param {*} data
 */
export function importEmployee(data) {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  }

  )
}

/**
 * @description 保存员工基本信息
 * @param {*} data
 */
export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}
